Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reindex replacements spans for completions to be 0-indexed #12332

Closed
wants to merge 2 commits into from

Conversation

aozgaa
Copy link
Contributor

@aozgaa aozgaa commented Nov 17, 2016

Fixes #12165, and possibly #11462.

Module and triple-slash-reference completions were added in PR #9353. They are the only completions
we provided which offer replacementSpan. The protocol the server uses to communicate with clients expects the spans in completion requests to be 0-indexed, but we were offering 1-indexed spans (consistent with spans for other types of requests such as quickinfo). This PR changes the server to behave as the editors (VS and VSCode) expect.

In order to prevent an issue like this from arising again, we should write integration tests in VS Code / VS to exercise the default spans that the editors offer.

@aozgaa
Copy link
Contributor Author

aozgaa commented Nov 17, 2016

Can you take a look, @billti , @mhegazy , @vladima ?

@billti
Copy link
Member

billti commented Nov 17, 2016

The protocol the server uses to communicate with clients expects the spans in completion requests to be 0-indexed, but we were offering 1-indexed spans (consistent with spans for other types of requests such as quickinfo)

So are we inconsistent with this across APIs? Seems like if editors are handling the positions in other APIs as 1-based, they should handle this also. Can you check the VS Code code to see if they are adjusting differently?

@aozgaa
Copy link
Contributor Author

aozgaa commented Nov 17, 2016

Fixed on the vscode side in microsoft/vscode#15679

@aozgaa aozgaa closed this Nov 17, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants